import request from '@/utils/request'

// 请求数组
export function getDepartments (data) {
    return request({
        url: '/company/department',
    })
}

// 删除数组
export function delDepartments (id) {
    return request({
        url: `/company/department/${id}`,
        method: 'delete'
    })
}

// 增加部门
export function addDepartments (data) {
    return request({
        url: `/company/department`,
        method: "post",
        data
    })
}
// 获取负责人数据
export function getEmployeeSimple () {
    return request({
      url: `/sys/user/simple`,
  
   })
  }
  // 获取部门数据
export function getDepartDetail (id) {
    return request({
      url: `/company/department/${id}`,
   })
  }
  /* 编辑部门数据*/
export function updateDepartments (data) {
    // 返回一个axios对象
    return request({
      url: `/company/department/${data.id}`,
      method: "put",
      data
   })
  }